from rest_framework import serializers
from Work import models
class workUserSer(serializers.ModelSerializer):
    userId = serializers.CharField(source="user.id")
    userName = serializers.CharField(source="user")
    class Meta:
        model = models.WorkUser
        fields = ["id", "userId","userName","state"]

class GroupGetSer(serializers.ModelSerializer):
    class Meta:
        model = models.WorkClass
        fields = ["id", "title"]

class ImgUrlGetSer(serializers.ModelSerializer):

    class Meta:
        model = models.WorkIMG
        fields = ["id", "url"]
        # exclude = ["userID"]
class WorkGetSer(serializers.ModelSerializer):
    class Meta:
        model = models.Work
        fields = ["id", "title",'msg']
        # exclude = ["userID"]

